function fn(url = "") {
    var param = {};
    var paramStr = url.split("?");
    if (paramStr.length > 1) {
        var paramKVArr = paramStr[1].split("&");
        paramKVArr.forEach(item => {
            let k_v = item.split("=");
            if (k_v.length > 1) {
                param[k_v[0]] = k_v[1]
            } else {
                param[k_v[0]] = undefined;
            }
        })
    }
    return param;
}

var url = "http://xxx.xxx.com:8001/api/blade-auth/oauth/token?tenantId=389767&username=admin&password=21232f297a57a5a743894a0e4a801fc3&grant_type=captcha&scope=all&type"
console.log(fn(url));